package com.huawei.appgallery.forum.search.card;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import com.huawei.appgallery.forum.base.card.bean.Post;
import com.huawei.appgallery.forum.base.card.bean.PostTime;
import com.huawei.appgallery.forum.cards.card.ForumPostCard;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import huawei.widget.HwTextView;
import o.btc;
import o.bzw.a;
import o.bzw.b;
import o.bzw.c;
import o.cgz;

public class ForumSearchPostCard extends ForumPostCard {
    private HwTextView ˋˋ = null;
    private ForumSearchPostCardBean ॱᐝ;

    public ForumSearchPostCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        super.ˏ(view);
        this.ʻ.setVisibility(8);
        this.ॱˊ.setVisibility(8);
        this.ˋˋ = (HwTextView) view.findViewById(a.ॱ);
        this.ˋˋ.setVisibility(0);
        RelativeLayout relativeLayout = (RelativeLayout) view.findViewById(a.ˊ);
        LayoutParams layoutParams = (LayoutParams) relativeLayout.getLayoutParams();
        layoutParams.height = -2;
        relativeLayout.setLayoutParams(layoutParams);
        relativeLayout.setPadding(0, ˉ().getResources().getDimensionPixelSize(b.ॱ), 0, ˉ().getResources().getDimensionPixelSize(b.ॱ));
        return this;
    }

    public void ˎ(View view) {
    }

    private void ॱॱ() {
        if (this.ॱᐝ != null) {
            LayoutParams layoutParams = (LayoutParams) this.ˎ.getLayoutParams();
            if (this.ॱᐝ.ॱˍ()) {
                layoutParams.topMargin = ˉ().getResources().getDimensionPixelSize(b.ˏ);
            } else {
                layoutParams.topMargin = ˉ().getResources().getDimensionPixelSize(b.ˊ);
            }
            this.ˎ.setLayoutParams(layoutParams);
        }
    }

    public void ˏ(CardBean cardBean) {
        if (cardBean instanceof ForumSearchPostCardBean) {
            this.ॱᐝ = (ForumSearchPostCardBean) cardBean;
            ॱॱ();
            super.ˏ(cardBean);
        }
    }

    public void ˎ(Post post) {
        this.ˎ.setTextHighLightColor(c.ˊ);
        this.ˎ.setTextHighLightTypeface("HwChinese-medium");
        this.ˎ.setTextToHighLight(this.ॱᐝ.ˊ());
        this.ˎ.setCaseInSensitive(true);
        this.ˎ.setData(post.ˊ(), post.ˋ());
    }

    public void ˏ(Post post) {
        this.ˏ.setText(post.ॱ());
        this.ˏ.setTextHighLightColor(c.ˊ);
        this.ˏ.setTextHighLightTypeface("HwChinese-medium");
        this.ˏ.setTextToHighLight(this.ॱᐝ.ˊ());
        this.ˏ.setCaseInSensitive(true);
        this.ˏ.ॱ();
    }

    public void ˎ() {
    }

    public void ˋ(PostTime postTime) {
        this.ˋˋ.setText(btc.ˏ(this.ʼॱ, postTime));
    }

    public void ˏ(boolean z) {
    }

    public void ˊ(Post post) {
        ˎ(post.ॱॱ());
    }
}
